﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using Code.Models;

namespace QianBuo.Lottery.Web.Areas.Manage.Models.CardsModels
{
    public class IndexModel
    {
        public CardSearchModel Search { get; set; }
        public IEnumerable<Code.BLL.CardManage.CardItem> Cards { get; set; }
        public int? Page { get; set; }
        public int? PageSize { get; set; }
        public int SumCount { get; set; }
        public List<SelectListItem> States { get; set; }
        public List<SelectListItem> DownTypes { get; set; }

        [Range(1,500,ErrorMessage="1-500张")]
        public int? AddCount { get; set; }
        [Range(0.01,double.MaxValue,ErrorMessage="不能小于0.01")]
        public double? Money { get; set; }
        public string DownType { get; set; }
    }
    
    public class CardSearchModel:Code.BLL.CardManage.CardSearchModel
    {
        [RegularExpression(@"\w{32}")]
        public override string Number
        {
            get
            {
                return base.Number;
            }
            set
            {
                base.Number = value;
            }
        }
        [Range(0.01,double.MaxValue,ErrorMessage="不能小于0.01")]
        public override double? Money
        {
            get
            {
                return base.Money;
            }
            set
            {
                base.Money = value;
            }
        }
    }
}